﻿namespace MES_SystemUI.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class updata : DbMigration
    {
        public override void Up()
        {
            DropIndex("dbo.DeviceCategories", new[] { "DeviceCategoryName" });
            DropIndex("dbo.Devices", new[] { "DeviceCode" });
            DropIndex("dbo.DeviceSpecs", new[] { "DeviceSpecName" });
            DropIndex("dbo.ProductCategories", new[] { "ProductCategoryName" });
            DropIndex("dbo.ProductionLineCategories", new[] { "ProductionLineCategorieName" });
            DropIndex("dbo.ProductionProcesses", new[] { "ProductionProcessCode" });
            DropIndex("dbo.ProductionProcesses", new[] { "ProductionProcessName" });
            DropIndex("dbo.ProductionTechnologies", new[] { "ProductionTechnologyCode" });
            DropIndex("dbo.ProductionTechnologies", new[] { "ProductionTechnologyName" });
            DropIndex("dbo.Products", new[] { "ProductCode" });
            DropIndex("dbo.Products", new[] { "ProductName" });
            DropIndex("dbo.ProductSpecs", new[] { "ProductSpecName" });
            DropIndex("dbo.StoreCategories", new[] { "StoreCategorieName" });
            DropIndex("dbo.Stores", new[] { "StoreCode" });
            DropIndex("dbo.Stores", new[] { "StoreName" });
            DropIndex("dbo.Teams", new[] { "TeamName" });
            DropIndex("dbo.Units", new[] { "UnitName" });
            DropIndex("dbo.Users", new[] { "UserName" });
            DropIndex("dbo.Users", new[] { "Phone" });
            DropIndex("dbo.WorkShopCategories", new[] { "WorkShopCategoryName" });
            DropIndex("dbo.WorkShops", new[] { "WorkShopName" });
        }
        
        public override void Down()
        {
            CreateIndex("dbo.WorkShops", "WorkShopName", unique: true);
            CreateIndex("dbo.WorkShopCategories", "WorkShopCategoryName", unique: true);
            CreateIndex("dbo.Users", "Phone", unique: true);
            CreateIndex("dbo.Users", "UserName", unique: true);
            CreateIndex("dbo.Units", "UnitName", unique: true);
            CreateIndex("dbo.Teams", "TeamName", unique: true);
            CreateIndex("dbo.Stores", "StoreName", unique: true);
            CreateIndex("dbo.Stores", "StoreCode", unique: true);
            CreateIndex("dbo.StoreCategories", "StoreCategorieName", unique: true);
            CreateIndex("dbo.ProductSpecs", "ProductSpecName", unique: true);
            CreateIndex("dbo.Products", "ProductName", unique: true);
            CreateIndex("dbo.Products", "ProductCode", unique: true);
            CreateIndex("dbo.ProductionTechnologies", "ProductionTechnologyName", unique: true);
            CreateIndex("dbo.ProductionTechnologies", "ProductionTechnologyCode", unique: true);
            CreateIndex("dbo.ProductionProcesses", "ProductionProcessName", unique: true);
            CreateIndex("dbo.ProductionProcesses", "ProductionProcessCode", unique: true);
            CreateIndex("dbo.ProductionLineCategories", "ProductionLineCategorieName", unique: true);
            CreateIndex("dbo.ProductCategories", "ProductCategoryName", unique: true);
            CreateIndex("dbo.DeviceSpecs", "DeviceSpecName", unique: true);
            CreateIndex("dbo.Devices", "DeviceCode", unique: true);
            CreateIndex("dbo.DeviceCategories", "DeviceCategoryName", unique: true);
        }
    }
}
